package code.lewdy.db;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import com.lt.member.MemberConfig;


public class DBTest
{
    public static void main(String[] args) throws ParseException
    {
    	//BetwayManage
       // int r = JdbcTemple.executeUpdate("update BetwayManage set betwayName='任选二星复式'  where betwayName='任选二星复试'");
       // System.out.println(r);
    	//System.out.println(JdbcTemple.executeUpdate("update Member set balance=balance+"+2+"where id=170"));
    	//120 或者 20 yyyy-mm-dd hh:mi:ss(24h) 
    	MemberConfig mcfg = (MemberConfig) HibernateTemple.load(MemberConfig.class, 1);
		Calendar c = Calendar.getInstance();
		int hour = c.get(Calendar.HOUR_OF_DAY);
		int minute = c.get(Calendar.MINUTE);
		int second = c.get(Calendar.SECOND);
    	JdbcUtil jdbc = new JdbcUtil(Database.TYPE_SQLSERVER);
    	Date d1 = new SimpleDateFormat("yyyy-MM-dd").parse("2012-7-4");
    	Date d2 = new Date();
    	int r = 0;
    	r = jdbc.getInt("select count(*) from WithdrawRecord where CONVERT(varchar(50) , createDate, 120 )<"+d2.getTime());
    	System.out.println(r);
    }
}
